Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added implementation for task hibernate order hw. #773

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

nklimovych
Copy link

Created Order entity, Dao and Service layers. Also hibernate the configuration file.

…y, Dao and Service layers. Also hibernate the configuration file.
Copy link

@karma-o karma-o left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Commented a couple of minor things, please check them out

Comment on lines +69 to +74
try {
newUser = authenticationService.register("newuser@gmail.com", "pass");
System.out.println(newUser);
} catch (RegistrationException e) {
throw new RuntimeException("Can't register a user: " + newUser, e);
}
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

in main we can rethrow exception to the method signature instead of try/catch but that is up to you

Comment on lines +20 to +24
@OneToMany(fetch = FetchType.LAZY)
private List<Ticket> tickets;
private LocalDateTime orderDate;
@ManyToOne(fetch = FetchType.LAZY)
private User user;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let's specify the join column to not let hibernate create a third table for each relation

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants